package com.wy.ssm01.utils;

import lombok.Data;

@Data
public class ResultBean {
    private Integer code;
    private String url;
    private Object data;
    private String message;
    public static final int OPERATION_SUCCESS = 1;
    public static final int OPERATION_FAILED = 0;

    public ResultBean(Integer code, String url, Object data, String message) {
        this.code = code;
        this.url = url;
        this.data = data;
        this.message = message;
    }

    public ResultBean() {
    }

    public static ResultBean getInstance(Integer code, String url, Object data, String message){
        return new ResultBean(code, url, data, message);
    }
    public static ResultBean getInstance(Integer code,Object data, String message){
        ResultBean resultBean = new ResultBean();
        resultBean.setCode(code);
        resultBean.setData(data);
        resultBean.setMessage(message);
        return resultBean;
    }
    public static ResultBean getInstance(Integer code, String message){
        ResultBean resultBean = new ResultBean();
        resultBean.setCode(code);
        resultBean.setMessage(message);
        return resultBean;
    }
    public static ResultBean getInstance(Integer code,String url, String message){
        ResultBean resultBean = new ResultBean();
        resultBean.setCode(code);
        resultBean.setUrl(url);
        resultBean.setMessage(message);
        return resultBean;
    }
}
